package com.cssl.controller;

import com.cssl.feign.UsersService;
import com.cssl.pojo.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class UsersController {
    @Autowired
    private UsersService service;

    @RequestMapping("/map")
    public Map<String,String> map(@RequestParam Map<String,String> map){
        System.out.println("consumer map:"+map);
        return service.map(map);
    }

    @GetMapping("/findUsers")
    public Users findUsers(Users user){
        System.out.println("consuer findUsers:"+user.getId());
        return service.find(user);
    }

    @PostMapping("/login")
    public String login(String username,String password){
        System.out.println("consumer login:"+username);
        return service.login(username,password);
    }
}
